<?
/*
 * 添加集团
 */
use pft\Member\MemberAccount;

include('common/header.html');
include("common/left.html");
include('common/autoload.php');
if($_SESSION['memberID']!=1 && !($_SESSION['sid']==1 && strpos($_SESSION['qx'],'addgroup'))){
    exit("不合法的身份访问！");
}
$tplFile = 'tpl/group_add.tpl';
$tplEngine = new IdiotTplEngine($tplFile);
$mem = new MemberAccount($GLOBALS['le']);
//判断该供应商是否已添加admin为他的分销商
$ret = $mem->chkRelationship($_SESSION['memberID'], MemberAccount::ADMINID);

$csrf_token = genCsrfToken();
$data = array('csrf_token'=>$csrf_token,'web_title'=>$GLOBALS['web_title']);
if(!$ret['id']) {
    $data['admin'] = $mem->GetOne(MemberAccount::ADMINID);
    //print_r($data['admin']);
}
$tplEngine->SetData($data);
echo $tplEngine->Render();
include('common/footer.html');
?>